package gui;

import java.awt.Color;
import java.beans.FeatureDescriptor;

import simulator.Node;
import simulator.SimulationDirector;

public class DifferenceBetweenEnergiesNodeLinePLotFrame extends LinePlotFrame {
	
	public double last_total_coop = 0,last_total_def = 0;
	
	
	public DifferenceBetweenEnergiesNodeLinePLotFrame(SimulationDirector sd,
			String title, int last, int update_on, Node n, Color clr) {
		super(sd, title, last, update_on, n, clr);
	}

	@Override
	protected double getCurrentValue() {
		double def = n.getTotal_energy_spent_cooperator()-last_total_coop;
		double cop = n.getTotal_energy_spent_deflector()-last_total_def;
		last_total_coop = n.getTotal_energy_spent_cooperator();
		last_total_def = n.getTotal_energy_spent_deflector();
		double diff = def-cop;
		return diff;
	}

}
